package com.java.io.piped;

import java.io.IOException;

/*
 * 管道流>>
 * 主要可以进行两个线程之间的通信。
 * PipedOutputStream 管道输出流
 * PipedInputStream 管道输入流
 */
public class Test {

	public static void main(String[] args) {
		try {
			Sender sender = new Sender();
			Receiver receiver = new Receiver();
			// 管道连接
			sender.getOut().connect(receiver.getIn());
			new Thread(sender).start();
			new Thread(receiver).start();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
